class User < ActiveRecord::Base
  has_many :designations
  has_many :projects, :through => :designations
  has_many :milestones
  has_many :activities, :foreign_key => "responsible_id"
  has_many :comments
  has_many :logs
  
  def self.authenticate(email, password)
    find.first(:conditions => ['email = ? AND password = ? AND active = 1', email, password.to_md5])
  end
  
end